package com.lry.basic.design_mode.observer.demo2;

/**
 * @author:刘仁有
 * @desc:
 * @email:953506233@qq.com
 * @data:2019/11/13
 */
public class Main {
    public static void main(String[] args) {
        WxServer server = new WxServer();
        User xm = new User("xm");
        User xh = new User("xh");
        User xb = new User("xb");
        server.registerObserver(xb);
        server.registerObserver(xm);
        server.registerObserver(xh);
        server.setServerPushMsg("java is the best language");
        server.removeObserver(xb);
        server.setServerPushMsg("php is the best language");
        System.out.println();
        server.notify(xm);
    }
}
